package com.sxt.test.com.sxt.consumer;

import java.util.List;

import com.sxt.core.consumer.scan.impl.RefObjectScanServiceImpl;
import com.sxt.core.context.IocContext;
import com.sxt.core.model.BeanDefine;
import com.sxt.core.utils.FactoryBeanUtil;
import com.sxt.core.utils.PackageScanUtil;
import com.sxt.core.utils.PropInjectUtil;
import com.sxt.test.com.sxt.consumer.service.ConsumerService;

public class ConsumerApp {
	public static void main(String[] args) {
		
		IocContext iocContext = new IocContext();
		List<BeanDefine> beanDefines = PackageScanUtil.packagSanAndGetBeanDefine("com.sxt.core.codc.impl,com.sxt.test.com.sxt.consumer.service.impl,com.sxt.core.consumer.rpc,com.sxt.core.consumer.zk,com.sxt.core.net.impl");
		FactoryBeanUtil.createObject(beanDefines, iocContext);
		PropInjectUtil.injectProps(beanDefines, iocContext);
		
		
		
		RefObjectScanServiceImpl refObjectScanServiceImpl = new RefObjectScanServiceImpl();
		refObjectScanServiceImpl.injectRefObject("com.sxt.core.codc.impl,com.sxt.test.com.sxt.consumer.service.impl,com.sxt.core.consumer.rpc,com.sxt.core.consumer.zk,com.sxt.core.net.impl", iocContext);
		//IOO 初始化完毕
		
		ConsumerService  consumerService= iocContext.getBean(ConsumerService.class);
		String answer = consumerService.getAnswer();
		System.out.println(answer);
          
	}
}
